<!DOCTYPE html>
<html lang="en">
<head>
	
	<!-- start: Meta -->
	<meta charset="utf-8" />
	<title>WCMS 登录</title>
	<meta name="description" content="SimpliQ - Flat & Responsive Bootstrap Admin Template." />
	<meta name="author" content="Łukasz Holeczek" />
	<meta name="keyword" content="SimpliQ, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina" />
	<!-- end: Meta -->
	
	<!-- start: Mobile Specific -->
	<meta name="viewport" content="width=device-width, initial-scale=1" />
	<!-- end: Mobile Specific -->
	
	<!-- start: CSS -->
	<link href="./static/bootstrap2/css/bootstrap.min.css" rel="stylesheet" />
	<link href="./static/bootstrap2/css/bootstrap-responsive.min.css" rel="stylesheet" />
	<link href="./static/bootstrap2/css/style.min.css" rel="stylesheet" />
	<link href="./static/bootstrap2/css/style-responsive.min.css" rel="stylesheet" />
	<link href="./static/bootstrap2/css/retina.css" rel="stylesheet" />
	<link href="./static/bootstrap2/css/my.css" rel="stylesheet" />
	<!-- end: CSS -->
	

	<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	  	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<link id="ie-style" href="css/ie.css" rel="stylesheet">
	<![endif]-->
	
	<!--[if IE 9]>
		<link id="ie9style" href="css/ie9.css" rel="stylesheet">
	<![endif]-->
	
	<!-- start: Favicon and Touch Icons -->
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png" />
	<link rel="shortcut icon" href="ico/favicon.png" />
	<script src="./static/public/jquery-1.11.0.min.js" type="text/javascript" ></script>
	
	<!-- end: Favicon and Touch Icons -->	
		
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{literal}
<style type="text/css">
body{	
padding-top: 0;
background-color: #142849;
background-image: -webkit-gradient(radial,center center,0,center center,460,from(#165387),to(#142849));
background-image: -webkit-radial-gradient(circle,#165387,#142849);
background-image: -moz-radial-gradient(circle,#165387,#142849);
background-image: -o-radial-gradient(circle,#165387,#142849);
}
</style>
{/literal}
</head>

<body>
		<div class="container-fluid-full">
		<div class="row-fluid">
					
			<div class="row-fluid">
			
				<div class="login-box">
<h1>WCMS V8</h1>
				
				{if $user.username==""}
				
					<h2></h2>
					<form class="form-inline" action="#" method="post" />
						<fieldset>
<span class="input-prepend input-append">
  <span class="add-on"><i class="icon-user"></i></span>

  							<input   name="mobile" id="username" type="text"  value="15800000000" />
  </span>
    <p></p>
    <span class="input-prepend input-append">
  <span class="add-on"><i class="icon-lock"></i></span>
							<input  name="password" id="password" type="password" value="123456" />
 
 </span>
<input type="text" name="codeimg" id="verifyCode" class="input-large span6" value="" />
  <img src="index.php?anonymous/captcha" id="verifyImg"  /><span class="tips"><a href="javascript:fleshVerify()" id="cap_resend" > 换一个</a></span>
							<div class="clearfix"></div>
							
							
							<div class="clearfix"></div>
							
							<button type="button"  onclick="return logincheck()"  class="btn btn-primary btn-large"><i class="icon-lock"></i>登录</button>
						</fieldset>	
					</form>
					{else}
					
					      <h1>Hi,<small>{$user.username}</small></h1>
					<div class="pull-left">
				<img src="{if $user.face==''}./static/attached/face/default_01.jpg{else}{$user.face}{/if}" class="img-circle" style="width:120px;height:120px;">
      </div>
      <p><a href="index.php?factory/iframe">后台管理</a>|<a href="index.php?anonymous/signout">退出</a></p>
 			
					
					
					{/if}
					<hr />
					<h3>初始帐号</h3>
					<p>
						© 2014 Wolf!<a href="mail:116311316@qq.com">116311316@qq.com</a>
					</p>	
				</div>
			</div><!--/row-->
			
				</div><!--/fluid-row-->
				
	</div><!--/.fluid-container-->

{literal}
<script language="javascript">
$(document).ready(function(){
$("#verifyCode").keydown(function(e){
  if(e.which==13){
	  logincheck();
  }
});

})
					


function logincheck() {
	var passwd= $("input[name='password']").val();
	var mobile = $("input[name='mobile']").val();
	var code= $("input[name='codeimg']").val();
	mobile=mobile.replace(/ /g,"");
	passwd=passwd.replace(/ /g,"");
                 if(mobile.length!=11){
               alert("手机号码应该为11位，请检查号码是否正确");
              return false;
        }


    	if (passwd.length <= 0) {
		alert("密码不能为空");
		return false;
	}

	if(code.length!=4){
	  alert("验证码填写错误");
	  return false;
	}

	$.post("./index.php?anonymous/setlogin", {
		password: passwd,
		mobile_phone: mobile,
		codeimg:code
	}, function(data) {

                  if(data.message!="success"){
		alert(data.message);
		fleshVerify();
                    return false;
                  }else{
                      location.reload();
                  }
	}, "json");
	
     //     location.reload();
	return false;

}


		 function fleshVerify(){
			//重载验证码
			    var timenow = new Date().getTime();
			    document.getElementById('verifyImg').src= './index.php?anonymous/captcha/?'+timenow;
			}
            </script>
{/literal}
</body>
</html>